﻿using System;

namespace Mono
{
	// Token: 0x02000007 RID: 7
	internal struct Disposable<T> : IDisposable where T : class, IDisposable
	{
		// Token: 0x0600001B RID: 27 RVA: 0x0000291F File Offset: 0x00000B1F
		public Disposable(T value, bool owned)
		{
			this.value = value;
			this.owned = owned;
		}

		// Token: 0x0600001C RID: 28 RVA: 0x000093A8 File Offset: 0x000075A8
		public void Dispose()
		{
			bool flag = this.value != null && this.owned;
			if (flag)
			{
				this.value.Dispose();
			}
		}

		// Token: 0x04000005 RID: 5
		internal readonly T value;

		// Token: 0x04000006 RID: 6
		private readonly bool owned;
	}
}
